package shape.material;

import javax.media.opengl.GL2;

public class Material {
	private float[] specular;
	private float[] emission;
	private float[] shininess;
	
	public Material() {
		specular = new float[4];
		emission = new float[4];
		shininess = new float[1];
		
		for (int i = 0; i < 3; i++) {
			specular[i] = 1.0f;
			emission[i] = 0.0f;
		}
		
		specular[3] = 1.0f;
		emission[3] = 1.0f;
		shininess[0] = 64f;
	}
	
	public void apply( GL2 gl ){
		gl.glMaterialfv( GL2.GL_FRONT, GL2.GL_SPECULAR, this.specular, 0 );
		gl.glMaterialfv( GL2.GL_FRONT, GL2.GL_EMISSION, this.emission, 0 );
		gl.glMaterialfv( GL2.GL_FRONT, GL2.GL_SHININESS, this.shininess, 0 );
	}
}
